package com.zryc.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 订单主表
 * </p>
 *
 * @author xujiajun
 * @since 2022-10-17
 */
@TableName("order_master")
@ApiModel(value = "OrderMaster对象", description = "订单主表")
public class OrderMaster implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("订单ID")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    @ApiModelProperty("订单编号 yyyymmddnnnnnnnn")
    private Long orderSn;

    @ApiModelProperty("下单人ID")
    private Integer customerId;

    @ApiModelProperty("用户地址表自增主键ID")
    private Integer customerAddrId;

    @ApiModelProperty("支付方式：1现金，2余额，3网银，4支付宝，5微信")
    private Byte paymentMethod;

    @ApiModelProperty("订单金额")
    private BigDecimal orderMoney;

    @ApiModelProperty("优惠金额")
    private BigDecimal districtMoney;

    @ApiModelProperty("运费金额")
    private BigDecimal shippingMoney;

    @ApiModelProperty("实际支付金额")
    private BigDecimal paymentMoney;

    @ApiModelProperty("快递公司名称")
    private String shippingCompName;

    @ApiModelProperty("快递单号")
    private String shippingSn;

    @ApiModelProperty("下单时间")
    private LocalDateTime createTime;

    @ApiModelProperty("发货时间")
    private LocalDateTime shippingTime;

    @ApiModelProperty("支付时间")
    private LocalDateTime payTime;

    @ApiModelProperty("收货时间")
    private LocalDateTime receiveTime;

    @ApiModelProperty("订单状态：-1已取消，0待付款，1已付款_待发货，2已发货_待收货，3已收货_待评价，4退款")
    private Byte orderStatus;

    @ApiModelProperty("订单积分")
    private Integer orderPoint;

    @ApiModelProperty("发票抬头")
    private String invoiceTime;

    private String note;

    @TableField(exist = false)
    private CustomerAddr addr;//当前订单收获地址

    @TableField(exist = false)
    private List<OrderDetail> orderDetails;

    public List<OrderDetail> getOrderDetails() {
        return orderDetails;
    }

    public void setOrderDetails(List<OrderDetail> orderDetails) {
        this.orderDetails = orderDetails;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public CustomerAddr getAddr() {
        return addr;
    }

    public void setAddr(CustomerAddr addr) {
        this.addr = addr;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Long getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(Long orderSn) {
        this.orderSn = orderSn;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public Integer getCustomerAddrId() {
        return customerAddrId;
    }

    public void setCustomerAddrId(Integer customerAddrId) {
        this.customerAddrId = customerAddrId;
    }

    public Byte getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(Byte paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public BigDecimal getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(BigDecimal orderMoney) {
        this.orderMoney = orderMoney;
    }

    public BigDecimal getDistrictMoney() {
        return districtMoney;
    }

    public void setDistrictMoney(BigDecimal districtMoney) {
        this.districtMoney = districtMoney;
    }

    public BigDecimal getShippingMoney() {
        return shippingMoney;
    }

    public void setShippingMoney(BigDecimal shippingMoney) {
        this.shippingMoney = shippingMoney;
    }

    public BigDecimal getPaymentMoney() {
        return paymentMoney;
    }

    public void setPaymentMoney(BigDecimal paymentMoney) {
        this.paymentMoney = paymentMoney;
    }

    public String getShippingCompName() {
        return shippingCompName;
    }

    public void setShippingCompName(String shippingCompName) {
        this.shippingCompName = shippingCompName;
    }

    public String getShippingSn() {
        return shippingSn;
    }

    public void setShippingSn(String shippingSn) {
        this.shippingSn = shippingSn;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getShippingTime() {
        return shippingTime;
    }

    public void setShippingTime(LocalDateTime shippingTime) {
        this.shippingTime = shippingTime;
    }

    public LocalDateTime getPayTime() {
        return payTime;
    }

    public void setPayTime(LocalDateTime payTime) {
        this.payTime = payTime;
    }

    public LocalDateTime getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(LocalDateTime receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Byte getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Byte orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getOrderPoint() {
        return orderPoint;
    }

    public void setOrderPoint(Integer orderPoint) {
        this.orderPoint = orderPoint;
    }

    public String getInvoiceTime() {
        return invoiceTime;
    }

    public void setInvoiceTime(String invoiceTime) {
        this.invoiceTime = invoiceTime;
    }

    @Override
    public String toString() {
        return "OrderMaster{" +
            "orderId = " + orderId +
            ", orderSn = " + orderSn +
            ", customerId = " + customerId +
            ", customerAddrId = " + customerAddrId +
            ", paymentMethod = " + paymentMethod +
            ", orderMoney = " + orderMoney +
            ", districtMoney = " + districtMoney +
            ", shippingMoney = " + shippingMoney +
            ", paymentMoney = " + paymentMoney +
            ", shippingCompName = " + shippingCompName +
            ", shippingSn = " + shippingSn +
            ", createTime = " + createTime +
            ", shippingTime = " + shippingTime +
            ", payTime = " + payTime +
            ", receiveTime = " + receiveTime +
            ", orderStatus = " + orderStatus +
            ", orderPoint = " + orderPoint +
            ", invoiceTime = " + invoiceTime +
        "}";
    }
}
